let PraiseModel = require('../model').praiseModel;
let DaoTool = require('../lib/daoTool');
exports.createPraise = function (conn,params) {
    return new Promise(function (resolve, reject) {
        let sql = "insert into praise set ?";
        conn.query(sql, [DaoTool.generateModelObject(params, PraiseModel, 'create')], function (err, result) {
            printLog("=createPraise=", this.sql);
            if (err) reject(err);
            resolve(result)
        });
    });
};
exports.deletePraise = function (conn,params) {
    return new Promise(function (resolve, reject) {
        let sql = "delete from praise where PraiseId=?";
        conn.query(sql, [params.PraiseId], function (err, result) {
            printLog("=deletePraise=", this.sql);
            if (err) reject(err);
            resolve(result)
        });
    });
};